Merge "Make convertUserOptions.php more self-contained"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 2 Jun 2014 22:50:44 +0000 (22:50 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 2 Jun 2014 22:50:44 +0000 (22:50 +0000)
1  2 
includes/User.php

diff --combined includes/User.php
@@@ -1253,9 -1253,6 +1253,6 @@@ class User 
                        $this->mNewpassword = $row->user_newpassword;
                        $this->mNewpassTime = wfTimestampOrNull( TS_MW, $row->user_newpass_time );
                        $this->mEmail = $row->user_email;
-                       if ( isset( $row->user_options ) ) {
-                               $this->decodeOptions( $row->user_options );
-                       }
                        $this->mTouched = wfTimestamp( TS_MW, $row->user_touched );
                        $this->mToken = $row->user_token;
                        if ( $this->mToken == '' ) {
        /**
         * Set the given option for a user.
         *
 +       * You need to call saveSettings() to actually write to the database.
 +       *
         * @param string $oname The option to set
         * @param mixed $val New value to set
         */
                }
        }
  
-       /**
-        * Set this user's options from an encoded string
-        * @param string $str Encoded options to import
-        *
-        * @deprecated since 1.19 due to removal of user_options from the user table
-        */
-       private function decodeOptions( $str ) {
-               wfDeprecated( __METHOD__, '1.19' );
-               if ( !$str ) {
-                       return;
-               }
-               $this->mOptionsLoaded = true;
-               $this->mOptionOverrides = array();
-               // If an option is not set in $str, use the default value
-               $this->mOptions = self::getDefaultOptions();
-               $a = explode( "\n", $str );
-               foreach ( $a as $s ) {
-                       $m = array();
-                       if ( preg_match( "/^(.[^=]*)=(.*)$/", $s, $m ) ) {
-                               $this->mOptions[$m[1]] = $m[2];
-                               $this->mOptionOverrides[$m[1]] = $m[2];
-                       }
-               }
-       }
        /**
         * Set a cookie on the user's client. Wrapper for
         * WebResponse::setCookie
        }
  
        /**
 -       * @todo document
 +       * Saves the non-default options for this user, as previously set e.g. via
 +       * setOption(), in the database's "user_properties" (preferences) table.
 +       * Usually used via saveSettings().
         */
        protected function saveOptions() {
                $this->loadOptions();